varying vec3 texture_coordinate;

// Color of the material
uniform vec4 matColor;

// Cube map
//uniform samplerCube env;
uniform samplerCube hdrTexDiffuseSampler;
uniform samplerCube hdrTexReflectionSampler;
 // Reflected vector
varying vec3 R;
varying vec3 N;
varying vec3 E; // Incident vector, if we will implement view dependent
                // reflections in the future (fresnel effects).

void main (void)
{
    vec4 matColor = vec4(0.7, 0.7, 0.7, 1.0);
	vec4 diffuse = mix(matColor, textureCube(hdrTexDiffuseSampler, N), 0.9);
	vec4 reflected = textureCube(hdrTexReflectionSampler, R);
    vec4 color = mix(diffuse, reflected, 0.4);
    color.a = 1.0;
    
	gl_FragColor = color;
	
}
